<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%
String passwordMessage = (String) session.getAttribute("messagePasswordIsNotMatch");
if (passwordMessage == null) {
	passwordMessage = "";
}
session.setAttribute("messagePasswordIsNotMatch", null);

String usernameMessage = (String) session.getAttribute("messageUsernameExists");
if (usernameMessage == null) {
	usernameMessage = "";
}
session.setAttribute("messageUsernameExists", null);

String username = (String) session.getAttribute("username");
if (username == null) {
	username = "";
}
session.setAttribute("username", null);
%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>Register</title>
    <jsp:include page="/incl/page.script.jsp" flush="true"/>
    <jsp:include page="/incl/page.bootstrap.jsp" flush="true"/>
    <jsp:include page="/incl/page.css.jsp" flush="true"/>

    <script type="text/javascript">
        $(document).ready(function () {
            // set active navigation item
            $('li#register').addClass('active');
        });
    </script>
</head>
<body>
<div class="container">
    <div class="row-fluid">
        <div class="col-md-12" style="height: 120px;">
            <jsp:include page="/incl/page.loginform.jsp" flush="true"/>
        </div>
    </div>
    <jsp:include page="/incl/page.navigation.jsp" flush="true"/>
	<div class="row-fluid">
        <div class="col-md-12 panel panel-default">
     		<div class= "user-resgister center-block panel-body" style="width: 25%">
		        <form action="${pageContext.request.contextPath}/RegisterServlet" method="post" role="form">
					<div class="form-group">
						<label for="username" >Name account</label>
						<input name="username" id="username" class="form-control" type="text" value="<%=username%>"/>
						<p class="help-block" style="color: #ff0000"><%=usernameMessage %></p>
					</div>
					<div class="form-group">
						<label for="password">Password</label>
						<input name="password" id="password" class="form-control" type="password"/>
						<p class="help-block" style="color: #ff0000"><%=passwordMessage %></p>
					</div>
					<div class="form-group">
						<label for="rePassword">Re-enter Password</label>
						<input name="rePassword" id="rePassword" class="form-control" type="password"/>
					</div>
					<button type="submit" class="btn btn-primary">Sign up</button>
				</form>
			</div>
        </div>
    </div>
</div>
</body>
</html>